import os.path
import time
from selenium import webdriver
from selenium.webdriver.common.by import By

path = "D:/Code/SeleniumStudy/file"
if os.path.exists(path + '/LATEST_RELEASE'):
    os.remove(path + '/LATEST_RELEASE')
chromeOptions = webdriver.ChromeOptions()
prefs = {"download.default_directory": path}
chromeOptions.add_experimental_option("prefs", prefs)
driver = webdriver.Chrome(chromeOptions)
driver.maximize_window()
driver.get("https://registry.npmmirror.com/binary.html?path=chromedriver/")
time.sleep(2)
driver.find_element(By.XPATH, '/html/body/table/tbody/tr[156]/td[2]/a').click()

time.sleep(3)
driver.close()
